#include <stdio.h>

int main()
{	      	     
    int i, n;
    char ch[80], tran[80];

    printf("请输入字符：");
    gets(ch);
    printf("\n密码是：%s", ch);

    i = 0;
    while (ch[i] != '\0')
    {	      	     
        if ((ch[i] >= 'A') && (ch[i] <= 'Z'))
        {	      	     
            tran[i] = 26 + 64 - ch[i] + 1 + 64;
        }
        else if ((ch[i] >= 'a') && (ch[i] <= 'z'))
        {	      	     
            tran[i] = 26 + 96 - ch[i] + 1 + 96;
        }
        else
        {	      	     
            tran[i] = ch[i];
        }
        i++;
    }
    n = i;
    printf("\n原文是：");
    for (i = 0; i < n; i++)
    {	      	     
        putchar(tran[i]);
    }

    return 0;
}	      	     